﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ClientZone.aspx.cs" Inherits="Consulta_ClientZone" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
    .helpImage{cursor:pointer;display: inline-block; margin-top: 2px;margin-left:3px;}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h1 class="title">
        <asp:Label ID="Label1" runat="server" Text="<%$ Resources: ClientZone, ZonaClientesTitle %>"></asp:Label>
    </h1>
    <p>
        <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: ClientZone, ZonaClientesContent %>"></asp:Literal>
    </p>

    <asp:Panel runat="server" ID="ErrorAlert" Visible="false" style="margin: 10px 0px 10px 0px">
        <div class="ui-state-error ui-corner-all" style="margin-top: 20px; padding: 10px .7em;">
            <div>
            <span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
                <asp:Literal ID="MensajeError" runat="server"
                    Text="<%$ Resources: ClientZone,TramiteNoEncontrado %>">
                </asp:Literal>
            </div>
        </div>
    </asp:Panel>

    <div class="validationGroup" style="margin-left:100px;">
        <div class="field">
            <div class="label">
                <asp:Label ID="Label2" runat="server" Text="<%$ Resources: ClientZone, CodigoServicio %>"
                    AssociatedControlID="CodigoServicioTextBox"></asp:Label>
                <asp:Label ID="Label3" runat="server"
                    CssClass="mensajes">
                </asp:Label>
            </div>
            <asp:TextBox ID="CodigoServicioTextBox" runat="server" CssClass="normalField hint"
                ToolTip="<%$ Resources: ClientZone, CodigoServicioHint %>">
            </asp:TextBox>            
        </div>

        <div class="field">
            <div class="label">
                <asp:Label ID="Label4" runat="server" Text="<%$ Resources: ClientZone, Documento %>"
                    AssociatedControlID="DocumentoTextBox"></asp:Label>
                <asp:Label ID="Label5" runat="server"
                    CssClass="mensajes">
                </asp:Label>
            </div>
            <asp:TextBox ID="DocumentoTextBox" runat="server" CssClass="normalField hint"
                ToolTip="<%$ Resources: ClientZone, DocumentoHint %>">
            </asp:TextBox>
            
        </div>
        <div class="field">
            <div class="label">
                <asp:Label ID="Label6" runat="server" Text="<%$ Resources: ClientZone, Captcha %>"
                    AssociatedControlID="CaptchaControl"></asp:Label>
                <asp:Image ID="HelpImage" runat="server" ImageUrl="~/Images/help.png"
                    ToolTip="<%$ Resources: ClientZone, CaptchaHint %>"
                    AlternateText=""
                    CssClass="helpImage" />
                <asp:Label ID="CaptchaError" runat="server"
                    CssClass="mensajes">
                </asp:Label>
            </div>
            <recaptcha:RecaptchaControl ID="CaptchaControl" runat="server"
                Theme="white"
                PublicKey="6Lc6uMcSAAAAAAQpyS_5M6puCIupokfNI1QTEDUZ"
                PrivateKey="6Lc6uMcSAAAAAKJ4iElCxNiQiAGlOfffyZuh_RKA" />        
        </div>

        <div class="buttonsPanel">
            <asp:LinkButton ID="ConsultarLinkButton" runat="server"
                CssClass="button causesValidation"
                OnClick="ConsultarLinkButton_Click"
                Text="<%$ Resources: ClientZone, BotonConsultar %>">
            </asp:LinkButton>
        </div>
    </div>

    <script type="text/javascript">
        $(document).ready(function () {
            $(".hint").tipTip({ defaultPosition: 'right', activation: 'focus', maxWidth: "300px" });
            $("#<%= HelpImage.ClientID %>").tipTip({ defaultPosition: 'right', activation: 'hover' });
            $("form").validate({
                onsubmit: false,
                errorPlacement: function(error, element) {
                    if(element.attr("name") == "recaptcha_response_field")
                        error.appendTo($("#<%= CaptchaError.ClientID %>"));
                    else
                        error.appendTo(element.prev("div.label").children("span.mensajes")); //pone el mensaje de error en el label del field
                },
                rules: {
                    <%= CodigoServicioTextBox.UniqueID %>: {
                        required: true
                    },
                    <%= DocumentoTextBox.UniqueID %>: {
                        required: true
                    },
                    recaptcha_response_field: {
                        required: true
                    }
                },
                messages: {
                    <%= CodigoServicioTextBox.UniqueID %>: {
                        required: "<%= Resources.ClientZone.CodigoServicioRequerido %>"
                    },
                    <%= DocumentoTextBox.UniqueID %>: {
                        required: "<%= Resources.ClientZone.DocumentoRequerido %>"
                    },
                    recaptcha_response_field: {
                        required: "<%= Resources.ClientZone.CaptchaRequerido %>"
                    }
                }
            });
        });
    </script>
</asp:Content>

